<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.css" />
		<link rel="stylesheet" href="../css/public.css" />
		<link rel="stylesheet" href="../css/my.css" />
	</head>

	<body>
		<div class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll">
				<div class="my-head-box">
					<div class="my-top clearfix">
						<a class="my-topitem fl" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-set.png"/>
						</a>
						<a class="my-topitem fr" href="notice.html" name="notice">
							<img class="iconfont" src="../img/icon-notice.png"/>
						</a>
					</div>
					<div class="my-head layout-center">
						<img id="avatar" class="my-headimg" src="../img/img-user.png" />
						<div id="login-user" class="user-info flex-item1">
							<!--已登录-->
							<!--<div class="name">jd_187959owu</div>
							<div class="rank"><span class="letter">G</span>黄金会员</div>
							<img class="my-credit" src="../img/img-my-img1.png" />-->
							
							<!--未登录-->
							<!--<a id="loginBtn" class="btn-login" href="javascript:void(0);">立即登录</a>-->
						</div>
					</div>
				</div>

				<ul class="my-nav clearfix">
					<li>
						<a href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mynav1.png"/>
							<p class="text mui-ellipsis">签到</p>
						</a>
					</li>
					<li>
						<a href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mynav2.png"/>
							<p class="text mui-ellipsis">早起打卡</p>
						</a>
					</li>
					<li>
						<a href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mynav3.png"/>
							<p class="text mui-ellipsis">日历</p>
						</a>
					</li>
					<li>
						<a href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mynav4.png"/>
							<p class="text mui-ellipsis">任务</p>
						</a>
					</li>
				</ul>

				<ul class="my-list">
					<li class="r-arrow">
						<a class="layout-center" href="card_bag.html" name="card_bag">
							<img class="iconfont" src="../img/icon-mylist1.png"/>
							<span class="text">我的卡包</span>
						</a>
					</li>
					<li class="r-arrow">
						<a class="layout-center" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mylist2.png"/>
							<span class="text">我的账单</span>
						</a>
					</li>
					<li class="r-arrow">
						<a class="layout-center" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mylist3.png"/>
							<span class="text">会员中心</span>
						</a>
					</li>
					<li class="r-arrow">
						<a class="layout-center" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mylist4.png"/>
							<span class="text">借贷平台</span>
						</a>
					</li>
					<li class="r-arrow mt10">
						<a class="layout-center" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mylist5.png"/>
							<span class="text">我的预约</span>
						</a>
					</li>
					<li class="r-arrow">
						<a class="layout-center" href="javascript:void(0);">
							<img class="iconfont" src="../img/icon-mylist6.png"/>
							<span class="text">关于我们</span>
						</a>
					</li>
					<li class="mt10">
						<a class="layout-center" href="javascript:void(0);" name="exit">
							<img class="iconfont" src="../img/icon-mylist7.png"/>
							<span class="text">退&nbsp;&nbsp;&nbsp;&nbsp;出</span>
						</a>
					</li>
				</ul>
			</div>
		</div>
	</body>
	<script src="../js/mui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		mui.init();

		mui('.mui-scroll-wrapper').scroll({
			deceleration: 0.0005,
			bounce: false
		});

		mui.plusReady(function() {
			init();
		});
		
		function init(){
			
			console.log("my:"+common.getLocVal("userId"));
			if(common.getLocVal("userId") !== ''){
				
				document.getElementById("login-user").innerHTML = '<div class="name">'+common.getLocVal("userName")+'</div>'+
																'<div class="rank"><span class="letter">G</span>黄金会员</div>'+
																'<img class="my-credit" src="../img/img-my-img1.png" />';
				var avatar = common.getLocVal("avatar");
				console.log(avatar);
				console.log(SERVER_PATH + avatar);
				if(avatar == ''){
					document.getElementById("avatar").src = "../img/img-user.png";
				}else{
					document.getElementById("avatar").src = "../img/img-user.png" ; //SERVER_PATH + avatar;
				}
			}else{
				document.getElementById("avatar").src = "../img/img-user.png";
				document.getElementById("login-user").innerHTML = '<a id="loginBtn" class="btn-login" href="javascript:void(0);">立即登录</a>';
				login();
			}
		}
		
		mui(".my-list").on('tap', 'li a', function() {
			if(common.getLocVal("userId") == ''){
				common.toast("请先登录");
				return false;
			}else{
				var name = this.getAttribute("name");
				if(name=='exit'){
					common.clearLocVal();
					init();
					//common.closeWin();
				}else{
					var href = this.getAttribute("href");
					mui.openWindow({
						url: href,
						id: name
					});
				}
			}
		});
		
		mui(".my-top").on('tap', '.my-topitem', function() {
			var href = this.getAttribute("href");
			var name = this.getAttribute("name");
			mui.openWindow({
				url: href,
				id: name
			});
		});
		
		function login(){
			document.getElementById("loginBtn").addEventListener('tap', function() {
				mui.openWindow({
					url: "./login.html",
					id: "login"
				})
			});
		}
	</script>

</html>